package org.jivesoftware.smackx.pubsub;

import org.jivesoftware.smackx.pubsub.util.XmlUtils;

public class OptionsExtension extends NodeExtension
{
  protected String id;
  protected String jid;

  public OptionsExtension(String paramString)
  {
    this(paramString, null, null);
  }

  public OptionsExtension(String paramString1, String paramString2)
  {
    this(paramString1, paramString2, null);
  }

  public OptionsExtension(String paramString1, String paramString2, String paramString3)
  {
    super(PubSubElementType.OPTIONS, paramString2);
    this.jid = paramString1;
    this.id = paramString3;
  }

  public String getId()
  {
    return this.id;
  }

  public String getJid()
  {
    return this.jid;
  }

  public String toXML()
  {
    StringBuilder localStringBuilder = new StringBuilder("<");
    localStringBuilder.append(getElementName());
    XmlUtils.appendAttribute(localStringBuilder, "jid", this.jid);
    if (getNode() != null)
      XmlUtils.appendAttribute(localStringBuilder, "node", getNode());
    if (this.id != null)
      XmlUtils.appendAttribute(localStringBuilder, "subid", this.id);
    localStringBuilder.append("/>");
    return localStringBuilder.toString();
  }
}